package com.intramirror.wd.service.security.service;

import com.intramirror.wd.business.manage.UserManage;
import com.intramirror.wd.model.po.TransitUser;
import com.intramirror.wd.service.security.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author mars
 * @date 2017-08-15.
 */
@Service
public class UserInfoService {
    @Autowired
    private UserManage userManage;

    public UserInfo findByName(String username) {

        TransitUser user = userManage.findUserByUserName(username);
        if(user!=null){
            return new UserInfo(user.getUserId(),user.getUsername(),user.getPassword(),user.getUserImage());
        }
        return null;
    }
}
